package learn_concurrent._9;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class T2 {
	static final Logger logger = LoggerFactory.getLogger(T2.class);

	static boolean run = true;
	static final Object lock = new Object();

	public static void main(String[] args) throws InterruptedException {
		Thread t1 = new Thread(() -> {
			while (true) {
				synchronized (lock) {
					if (!run)
						break;
				}
			}
		});
		t1.start();

		Thread.sleep(1000);
		logger.info("stop tt");
//		synchronized (lock) {
			run = false;
//		}
	}

}
